package com.peng.panels;

import com.alibaba.fastjson.JSON;
import com.peng.component.MyJTextArea;
import com.peng.data.WakCommonData;
import com.peng.event.WakBatchExParamEadListener;
import com.peng.utils.EncryptUtils;
import com.peng.utils.ExportExcelUtil;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
import java.util.*;

/**
 * @author : pengyf
 * @version : 1.0
 * @createTime : 2022/1/22 16:19
 * @Description : TODO
 */
public class WakBatchEadPanel extends JPanel {
    private int w = 800;
    private int h = 460;
    private String key;
    private String iv;
    private FileDialog fileDialog;

    public WakBatchEadPanel(String key, String iv, FileDialog fileDialog) {
        super();
        this.key = key;
        this.iv = iv;
        this.fileDialog = fileDialog;
        setLayout(null);
        init();
    }

    public void init(){
        JLabel jLabel = new JLabel("提示：需要随机生成的参数使用$代替，一个$等于一个随机字符！");
        jLabel.setBounds(10,10, w-40, 30);
        jLabel.setFont(WakCommonData.DEFAULTFONT);

        MyJTextArea myJTextArea = new MyJTextArea(10,50,w-40,300);
        JScrollPane jScrollPane = myJTextArea.scrollJTextArea();

        JLabel jLabel2 = new JLabel("生成数量：");
        jLabel2.setBounds(10,360, 120, 30);
        jLabel2.setFont(WakCommonData.DEFAULTFONT);
        JTextField jTextField = new JTextField();
        jTextField.setBounds(120,360, 180, 30);
        jTextField.setFont(WakCommonData.DEFAULTFONT);
        jTextField.setText("1");

        JButton jb1 = new JButton();
        jb1.setBounds(310,360, 160, 30);
        jb1.setText("生成并导出数据");
        jb1.addActionListener(new WakBatchExParamEadListener(key,iv,fileDialog,myJTextArea,jTextField));

        add(jScrollPane);
        add(jLabel);
        add(jLabel2);
        add(jTextField);
        add(jb1);
    }



}
